home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak Vol E-12
/
(Vol E-12) May 21 2012.iso
/
Animations
/
dj
/
dj.swf
/
scripts
/
__Packages
/
mx
/
controls
/
streamingmedia
/
ScreenAccommodator.as
< prev
next >
Wrap
Text File
|
2012-05-21
|
2KB
|
80 lines
class mx.controls.streamingmedia.ScreenAccommodator
{
var initAction = "nothing";
function ScreenAccommodator(aContainee)
{
this.containee = aContainee;
this.container = this.getContainingScreen();
if(this.container != null)
{
var _loc2_ = this.container.__get__visible();
this.beforeInit = false;
this.container.addEventListener("hide",this);
this.container.addEventListener("reveal",this);
if(!_loc2_)
{
this.beforeInit = true;
this.initId = setInterval(this,"disableContainee",50);
}
}
}
function disableContainee()
{
if(this.initAction == "nothing" || this.initAction == "hide")
{
mx.controls.streamingmedia.Tracer.trace("ScreenAccommodator.disableContainee: disabling " + this.containee);
this.containee.enabled = false;
}
clearInterval(this.initId);
this.beforeInit = false;
}
function getContainingScreen()
{
var _loc4_ = null;
var _loc3_ = this.containee._parent;
while(_loc4_ == null && _loc3_ != _root)
{
if(_loc3_ instanceof mx.screens.Screen)
{
_loc4_ = _loc3_;
}
else
{
_loc3_ = _loc3_._parent;
}
}
return _loc4_;
}
function handleEvent(ev)
{
mx.controls.streamingmedia.Tracer.trace("ScreenAccommodator.handleEvent: " + ev.type + " for " + this.containee);
if(ev.type == "hide")
{
if(this.beforeInit)
{
this.initAction = "hide";
}
else if(this.containee.enabled)
{
this.wasAlreadyDisabled = false;
this.containee.enabled = false;
}
else
{
this.wasAlreadyDisabled = true;
}
}
else if(ev.type == "reveal")
{
if(this.beforeInit)
{
this.initAction = "reveal";
}
else if(!this.wasAlreadyDisabled && this.containee.visible)
{
this.containee.enabled = true;
}
}
}
}